package com.jlkf.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.jlkf.service.OrderItemsService;

@Controller
@RequestMapping("orderItems")
public class OrderItemsController {

	@Autowired
	private OrderItemsService orderItemsService;
	/**
	 * 未完成订单列表
	 * @param orderNo
	 * @param createTime
	 * @param status
	 * @param carType
	 * @param licensePlate
	 * @param telephone
	 * @param driverName
	 * @param driverPhone
	 * @param pageNo
	 * @param pageSize
	 * @return
	 */
	@RequestMapping("getUnfinishedList")
	public Object getUnfinishedList(String orderNo,String createTime,Integer status,Integer carType,String licensePlate,String telephone,
			String driverName,String driverPhone,Integer pageNo,Integer pageSize,Integer queryType,Integer refundsPrice){
		return orderItemsService.getUnfinishedList(orderNo, createTime, status, carType, licensePlate, telephone,driverName,driverPhone,pageNo,pageSize,queryType,refundsPrice);
	}
	//扣取行程费
	@RequestMapping("buckleTravelFee")
	public Object buckleTravelFee(@RequestBody String json){
		return orderItemsService.buckleTravelFee(json);
	}
	
	/**
	 * 财务管理 未结算统计
	 * @param driverName
	 * @param driverPhone
	 * @param pageNo
	 * @param pageSize
	 * @return
	 */
	@RequestMapping("getNoSettlement")
	public Object getNoSettlement(String driverName,String driverPhone,Integer pageNo,Integer pageSize){
		return orderItemsService.getNoSettlement(driverName, driverPhone, pageNo, pageSize);
	}
	//财务管理 未结算统计 订单详情
	@RequestMapping("getNoSettlementDetail")
	public Object getNoSettlementDetail(String driverId,Integer pageNo,Integer pageSize,Integer status){
		return orderItemsService.getNoSettlementDetail(driverId, pageNo, pageSize,status);
	}
	
	//未完成订单导出
	@RequestMapping("getUnfinishedExport")
	public void getUnfinishedExport(String orderNo,String createTime,Integer status,Integer carType,String licensePlate,String telephone,
			String driverName,String driverPhone,Integer queryType,HttpServletResponse response,HttpServletRequest request){
		 orderItemsService.getUnfinishedExport(orderNo, createTime, status, carType, licensePlate, telephone,driverName,driverPhone,queryType,response,request);
	}
	
	//已完成订单导出
	@RequestMapping("getCompleteExport")
	public void getCompleteExport(String orderNo,String createTime,Integer status,Integer carType,String licensePlate,String telephone,
			String driverName,String driverPhone,Integer queryType,HttpServletResponse response,HttpServletRequest request,Integer refundsPrice){
		 orderItemsService.getCompleteExport(orderNo, createTime, status, carType, licensePlate, telephone,driverName,driverPhone,queryType,response,request,refundsPrice);
	}
	
//未结算账单导出
	/*@RequestMapping("getNoSettlementExport")
	public void getNoSettlementExport(String driverName,String driverPhone,HttpServletResponse response,HttpServletRequest request){
		 orderItemsService.getNoSettlementExport(driverName,driverPhone,response,request);
	}*/
	
}
